<style>
.pure_form_extra { background: #fff; padding: 10px; border: 1px solid #aaa; border-radius: 8px; font-size: 12px; font-family: Trebuchet MS; }
</style>

<?php 
$track_id = Utils::get_param('t', '');
$opts = new stdClass();
$opts->cd = 't.track_id = :v1';
$opts->cdv = array(':v1' => $track_id);
$opts->sel = 't.*, t1.title AS __member, t1.discount AS __discount';
$opts->jt = 'LEFT JOIN pb_ecom_membership AS t1 ON t1.id = t.member_id';
$data = $orm->get('pb_ecom_customer', NULL, NULL, NULL, NULL, $opts)->d;
if (count($data) > 0 && $data[0]->status == 0) {
  $data[0]->status = 1;
  $orm->update('pb_ecom_customer', $data[0]);
  $opts = new stdClass();
  $opts->cd = 't.customer_id = :v1';
  $opts->cdv = array(':v1' => $data[0]->id);
  $data[0]->__addrs = $orm->get('pb_ecom_customer_addr', NULL, NULL, NULL, NULL, $opts)->d;
  unset($data[0]->password);
  $_SESSION['user'] = json_encode($data[0]);
}
?>

<?php if (count($data) > 0) { ?>
<div class="pure-form pure-form-aligned pure_form_extra">恭喜您！激活成功！现在您已经成为注册用户</div>
<?php } ?>